//package cn.itcast.order.service;
//
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.stereotype.Service;
//
//import java.util.concurrent.CompletableFuture;
//
///**
// * @author danDong
// * @date 2025-02-07 15:22:20
// */
//@Service
//public class AsyncService {
//    @Async
//    public CompletableFuture<String> asyncMethod() {
//        try {
//            // 模拟耗时操作
//            Thread.sleep(5000); // 模拟操作
//            System.out.println("我是异步操作-----------哈哈哈");
//            return CompletableFuture.completedFuture("Done");
//        } catch (InterruptedException e) {
//            return CompletableFuture.failedFuture(e);
//        }
//    }
//}
